package com.quotientintelligence.caftrak.shared;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.users.User;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable
public class ConsumptionEvent {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key _key;
	
	@Persistent
	private User _user;
	
	@Persistent
	private Substance _drink;
	
	@Persistent
	private Date _date;
	
	public ConsumptionEvent(User u, Substance bev)
	{
		this(u,bev, new Date());
	}
	public ConsumptionEvent(User u, Substance bev, Date date){
		this._user = u;
		this._drink = bev;
		this._date = date;
	}

    public Key getKey() {
        return _key;
    }

    public User getUser() {
        return _user;
    }

    public Substance getSubstance() {
        return _drink;
    }

    public Date getDate() {
        return _date;
    }
}
